package main

import (
	"fmt"
	"log"
	"net/rpc"
)

func main() {
	conn, err := rpc.DialHTTP("tcp", ":8000")
	if err != nil {
		log.Fatal(err)
	}

	ret := 0
	err2 := conn.Call("React.Area", Param{100, 100}, &ret)
	if err2 != nil {
		log.Fatal(err)
	}

	fmt.Printf("面积是%d", ret)

	err3 := conn.Call("React.Perimeter", Param{100, 100}, &ret)
	if err3 != nil {
		log.Fatal(err3)
	}
	fmt.Printf("周长是%d", ret)
}

type Param struct {
	Height, Width int
}
